package com.tuscanyscatours.launcher;

import org.apache.tuscany.sca.Node;
import org.apache.tuscany.sca.TuscanyRuntime;
import org.apache.tuscany.sca.node.ContributionLocationHelper;

import com.tuscanyscatours.impl.TripBookingImpl;

public class TourLauncher {

	public static void main(String[] args) throws Exception{
		System.out.println("Starting Tours ....");
        String contributionURL = ContributionLocationHelper.getContributionLocation(TripBookingImpl.class);
      
        
        TuscanyRuntime runtime= TuscanyRuntime.newInstance();
        Node node = runtime.createNode(TuscanyRuntime.DEFAUL_DOMAIN_NAME);
        
        node.installContribution(contributionURL);
        node.startComposite("introducing-tours-distributed","tours.composite");
        System.out.println("tours.composite ready for big business !!!");
        
        System.in.read();
        System.out.println("Stopping ...");
        node.stop();
        System.out.println();

	}

}
